package com.cac.demo.newCode.interfaceLog.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 接口日志表
 */
@Data
@Accessors(chain = true)
@TableName(value = "INTERFACE_LOG")
public class InterfaceLog implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(value = "ID")
    private String id;

    /**
     * 接口描述
     */
    @TableField(value = "DESCRIPTION")
    private String description;

    /**
     * 请求URL
     */
    @TableField(value = "URL")
    private String url;

    /**
     * 请求方法
     */
    @TableField(value = "\"METHOD\"")
    private String method;

    /**
     * 请求参数
     */
    @TableField(value = "PARAMS")
    private String params;

    /**
     * 响应结果
     */
    @TableField(value = "RESPONSE")
    private String response;

    /**
     * 执行时间(毫秒)
     */
    @TableField(value = "EXECUTION_TIME")
    private BigDecimal executionTime;

    /**
     * 请求IP
     */
    @TableField(value = "IP")
    private String ip;

    /**
     * 用户代理
     */
    @TableField(value = "USER_AGENT")
    private String userAgent;

    /**
     * 状态（0正常 1异常）
     */
    @TableField(value = "\"STATUS\"")
    private Integer status;

    /**
     * 错误信息
     */
    @TableField(value = "ERROR_MSG")
    private String errorMsg;

    /**
     * 创建时间
     */
    @TableField(value = "CREATE_TIME")
    private Date createTime;
    /**
     * 错误信息
     */
    @TableField(value = "BKEY")
    private String bKey;
    /**
     * 错误信息
     */
    @TableField(value = "CEMOP_MSG")
    private String cemopMsg;
    /**
     * 错误信息
     */
    @TableField(value = "IS_RESULT")
    private Integer isResult;

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", description=").append(description);
        sb.append(", url=").append(url);
        sb.append(", method=").append(method);
        sb.append(", params=").append(params);
        sb.append(", response=").append(response);
        sb.append(", executionTime=").append(executionTime);
        sb.append(", ip=").append(ip);
        sb.append(", userAgent=").append(userAgent);
        sb.append(", status=").append(status);
        sb.append(", errorMsg=").append(errorMsg);
        sb.append(", createTime=").append(createTime);
        sb.append("]");
        return sb.toString();
    }
}